from core.basehandler import BaseHandler
from core.room import Room
from items.dadsuit import DadSuit
from items.goodwillsuit import GoodwillSuit
from items.snazzysuit import SnazzySuit
from core.action import Action


class SuitArea(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        self.add_item(DadSuit())
        self.add_item(GoodwillSuit())
        self.add_item(SnazzySuit())
        
        # build list of actions
        self.add_action(GoSalon)
        self.add_action(GoBedroom)
    
    # return description of room.
    def get_description(self):
        return '''
        Velma is a very sharp dresser so you should probably also look sharp when he asks her.  \n  
        Unfortunately, the only place in your price range is a second hand costume store.  \n
        Which outfit should you go purchase?  \n
        '''
    # return image of room
    def get_image(self):
        return 'velma.jpg'


class SuitAreaHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return SuitArea

# define actions for this room





class GoSalon(Action):
    def __init__(self):
        Action.__init__(self, "Go to the salon")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Get a haircut"
    
    # set cutscene for when arrive in entrance_hall
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'salon'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class GoBedroom(Action):
    def __init__(self):
        Action.__init__(self, "Bedroom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go back"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'bedroom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"